home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / zsh / Source / help / trap < prev    next >
Encoding:
Text File  |  1993-10-08  |  1.2 KB  |  21 lines

  1.        trap [ arg ] [ sig ] ...
  2.               arg is a command to be read and executed  when  the
  3.               shell  receives  sig.   Each  sig can be given as a
  4.               number or as the name of a signal.  Inside the com-
  5.               mand,  $1  refers to the number of the signal which
  6.               caused the trap.  If arg is -, then all  traps  sig
  7.               are  reset  to their default values.  If arg is the
  8.               null string, then this signal  is  ignored  by  the
  9.               shell  and  by  the commands it invokes.  If sig is
  10.               ZERR then arg will be executed after  each  command
  11.               with  a  nonzero exit status.  If sig is DEBUG then
  12.               arg will be executed after each command.  If sig is
  13.               0 or EXIT and the trap statement is executed inside
  14.               the body of a function, then  the  command  arg  is
  15.               executed after the function completes.  If sig is 0
  16.               or EXIT and the  trap  statement  is  not  executed
  17.               inside the body of a function, then the command arg
  18.               is executed when the shell  terminates.   The  trap
  19.               command with no arguments prints a list of commands
  20.               associated with each signal.
  21.